<html><head>
  <meta charset="utf-8">
  <title>网站设置</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
<body >

  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-header"></div>
          <div class="layui-card-body" pad15="">
            <div class="page-container">
         <form method="post" id="form_up" class="form form-horizontal" enctype="multipart/form-data">
        <div class="text-c" style="text-align: left;margin-top:200px;height:20px;">
            <div style="float:left;">
                安卓更新：<input type="text" class="input-text" style="width:155px;" placeholder="版本号例:1.0.0" value="{$data.apk.version?:''}" name="apk_version">
            </div>
            <div style="float:left;margin-left:20px;">
              <input type="file" name="apk_file">
            </div>
        </div>
       <div class="text-c" style="text-align: left;clear:both;margin-top:40px;">
            <div style="float:left;">
                苹果更新：<input type="text" class="input-text" style="width:155px;" placeholder="版本号例:1.0.0" value="{$data.ios.version?:''}" name="ipa_version">
            </div>
            <div style="float:left;margin-left:20px;">
            <input type="file" name="ipa_file">
            </div>
        </div>
    <div class="col-sm-3" style="text-align:right;clear:both;">
    <input class="btn btn-primary radius" onclick="form_submit();" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
               
            </div>
            </form>
</div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <script src="../../../layuiadmin/layui/layui.js"></script>  
  <script>
  layui.config({
    base: '../../../layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'set']);
  
  function form_submit(){
	  var formData=new FormData($('#form_up')[0]);
	  console.log(formData)
	  $.ajax({
        type: 'POST',
        url: 'update_app',
        data: formData,
        dataType: 'json',
        timeout: 3000,
        success: function (data) {
     	   console.log(data)
     	   if(data.code){
     		  layer.closeAll();layer.msg(data.msg);
     		  setTimeout(function(){
     			location.href = location.href;
              },700)
     	   }else{
     		  layer.msg(data.msg);
     	   }
        }
    })
}
  </script>


</body></html>

